# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.

# See the included README.md file for usage instructions.

# For VS2022 and Xcode 12+ support.
cmake_minimum_required(VERSION 3.21)

# Only generate Debug and Release configuration types.
set(CMAKE_CONFIGURATION_TYPES Release)
set(CMAKE_SUPPRESS_REGENERATION TRUE)
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
set(CMAKE_INSTALL_DEFAULT_TARGETS "")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
set(TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")

# Project name.
project(TestExe)

file(GLOB _SRC_FILES
    "*.cpp"
)

add_executable(${PROJECT_NAME} ${_SRC_FILES})
set(CMAKE_MFC_FLAG 1) 
target_compile_definitions(${PROJECT_NAME} PRIVATE
        -DWIN32
        -D_DEBUG
        -D_WINDOWS
        -D_UNICODE
        -DUNICODE
        -D_AFXDLL
        )

set(OUTPUT_BIN_FILES
  "${PROJECT_NAME}.exe"
  "${PROJECT_NAME}.pdb"
)
COPY_FILES("${PROJECT_NAME}" "${OUTPUT_BIN_FILES}" "${TARGET_OUT_DIR}" "${CMAKE_SOURCE_DIR}/Bin")

